/*************************************************************************
*																		 *
*				code by Miles Chen (v-mich) 2008.4.6					 *
*																		 *
*																		 *
*************************************************************************/

#pragma once

namespace System{namespace Windows{namespace Forms{

	typedef void (* APPENTRY)(void);

	int AppMain(APPENTRY lpEntry);
	BOOL SingleInstance(LPCWSTR lpszInstanceName);

	class CForm abstract : public CDialogImpl<CForm>
	{
	public:
		CForm();
		int IDD;

	protected:
		HINSTANCE m_hInst;
		int m_nAppIconID;
		HICON m_hAppIcon;

	private:
		HBRUSH m_hBrushDlg;

	public:
		BEGIN_MSG_MAP(CForm)

			MESSAGE_HANDLER(WM_CLOSE, OnClose)
			MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
			MESSAGE_HANDLER(WM_LBUTTONDOWN, OnLButtonDown)
			MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)
			MESSAGE_HANDLER(WM_CTLCOLORDLG, OnCtlColorDlg)
		END_MSG_MAP()
	
	
		LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
		LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
		LRESULT OnLButtonDown(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
		LRESULT OnCtlColorStatic(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
		LRESULT OnCtlColorDlg(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	};

}}}